//
//  LogView.swift
//  Example
//
//  Created by xx on 2025/3/20.
//

import UIKit
import FastSwiftSDK

class LogView: UIView {

    private lazy var txt_view : UITextView = {
        let txt =  UITextView.init()
        txt.backgroundColor = .lightGray
        txt.cornerRadius = 5
        self.addSubview(txt)
        return  txt
    } ()
    
    override func layoutSubviews() {
        super.layoutSubviews()
        txt_view.snp.makeConstraints { make in
            make.top.left.equalTo(5)
            make.bottom.right.equalTo(-5)
        }
    }
    
    func addLog(_ str:String){
        var all = ""
        if let last = self.txt_view.text{
            all = last
        }
        all = "\(all)\n time:\(FastDate().nowTimeStr(.HMS))  ——  msg:\(str)"
        self.txt_view.text = all
    }
    
}
